<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="../js/Calendar.js" language="javascript"></script>
<script src="../js/ajax.js" language="javascript"></script>
<title>教师用户注册</title>
</head>

<body>
<form action="teacher_user_reg.php" method="post" name="form1"  onsubmit="retrun checkform()" >
<div align="center">
    <table width="450" border="0">
      <tr>
        <td colspan="2" align="center"><h3>教师用户注册</h3></td>
      </tr>
      <tr>
        <td align="right">用户名：</td>
        <td width="262"><input title="请输入6-20位之间的用户名" type="text" id="username" name="username"  onchange="getData('../teacher/checkinfo.php?type=username&amp;id='+this.value,'usernamemsg');"/><span id="usernamemsg"></span></td>
      </tr>
      <tr>
        <td align="right">密码：</td>
        <td><input type="password" title="请输入6-20位之间的密码" name="password"  id="password" onchange="getData('../teacher/checkinfo.php?type=password&amp;id='+this.value,'passwordmsg');"/><span id="passwordmsg"></span></td>
      </tr>
      <tr>
        <td align="right">身份证号码：</td>
        <td><input title="请输入18位身份证号码" maxlength="18"  type="text" id="idcard" name="idcard" onchange="getData('../teacher/checkinfo.php?type=idcard&amp;id='+this.value,'idcardmsg');"/><span id="idcardmsg"></span></td>
      </tr>
      <tr>
        <td colspan="2" align="center"><h3><input type="submit" id="submit" class="inputButton" value="提交" /></h3><span id="submitmsg"></span></td>
      </tr>
    </table>
</div>
</form>
<script type="text/javascript">
	function checkform(){
		//获取用户填写信息
		username = document.getElementById('username').value;
		password = document.getElementById('password').value;
		idcard = document.getElementById('idcard').value;
		
		//首先检测用户名密码是否正确
		usernamemsg = document.getElementById('usernamemsg').innerHTML;
		passwordmsg = document.getElementById('passwordmsg').innerHTML;
		idcardmsg = document.getElementById('idcardmsg').innerHTML;
		sumbitmsg=0;
		
		if(usernamemsg.indexOf('right')>0 && passwordmsg.indexOf('right')>0 && idcardmsg.indexOf('right')>0){
			sumbitmsg=1;
			return true;
		}else{
			sumbitmsg=0;
			alert("请检查填写的内容！");
			return false;
		}
		
	}
</script>
</body>
</html>










